<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Insert title here</title>
        <script type="text/javascript">
        	function checkphone(formobj1){
				var phone= formobj1.mytext.value;
				var check=/^([0-9]{3}){0,1}[ \-\.]{0,1}[0-9]{3}[ \-\.]{0,1}[0-9]{4}$/;
				if(!check.test(phone)){
					alert("phone invalid");
					return false;
				}
				return true;
			}
        	function checknum(numobj1){
				var num= numobj1.value;
				var check2=/^[0-9]+\.?[0-9]+$/;
				if(!check2.test(num)){
					alert("num invalid");
					return false;
				}
				return true;
			}
        </script>
    </head>
    <body>
    	<form action="radio.html" name="myForm" onsubmit="return checkphone(this);">
    		phone:<input name="mytext"></input><br>
			num:<input name="mynum" onblur="checknum(this);"></input>
			<br><input type="submit"/>
    	</form>
    </body>
</html>
